import constant from "./constant";
import { leftAsideStore } from 'maotu';
import demo from '/svgs/demo.svg?raw';
export default {
  a:'bbb',
  zoom() {
    let oBody = document.getElementsByTagName('div')[0];


    /*寬高同時縮放不同比例*/
    /*
    let xWidth= window.innerWidth>=1024?window.innerWidth:1024;//寬度最小1024
    let yHeight= window.innerHeight>=576?window.innerHeight:576;//調試最小576

    let x = xWidth / constant.constant.PAGE_WIDTH;
    let y = yHeight / constant.constant.PAGE_HEIGHT;

    oBody.style.transform = `scale(${x}, ${y})`;
    oBody.style.webkitTransform = `scale(${x} , ${y})`;// for Chrome || Safari
    oBody.style.msTransform = `scale(${x}, ${y})`;// for Firefox
    oBody.style.mozTransform = `scale(${x}, ${y})`;// for IE
    oBody.style.oTransform = `scale(${x}, ${y})`;// for Opera
    */

    /*寬高縮放同樣比例*/
    
    let x = window.innerWidth / constant.constant.PAGE_WIDTH;
    oBody.style.transform = `scale(${x})`;
    oBody.style.webkitTransform = `scale(${x})`;// for Chrome || Safari 
    oBody.style.msTransform = `scale(${x})`;// for Firefox 
    oBody.style.mozTransform = `scale(${x})`;// for IE 
    oBody.style.oTransform = `scale(${x})`;// for Opera 
    
  },
  initMaotuAside(){
    leftAsideStore.registerConfig('svg文件', [
      {
        id: 'demo',
        title: '演示svg文件',
        type: 'svg',
        thumbnail: '/svgs/demo.svg',
        svg: demo,
        props: {
          fill: {
            type: 'color',
            val: '#FF0000',
            title: '填充色'
          }
        }
      },
      {
        id: 'my-img',
        title: '我的图片',
        type: 'img',
        thumbnail: '/imgs/my-img.png', //支持远程地址,也支持svg，只是不能变色之类的了，不过会保留矢量属性
        props: {
    
        }
      }
        ]);

  }
};
